package com.imti.mall.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.imti.mall.model.pms.pojo.PmsMemberPrice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface MemberPriceMapper extends BaseMapper<PmsMemberPrice> {
    /**
     *根据商品id和用户会员等级信息 查询会员等级价格表
     * @param productId 商品id
     * @param memberLevelId 用户等级id
     * @return 返回值为一条或空(无会员优惠)
     */
    @Select("select member_price from pms_member_price where product_id=#{productId} and  member_level_id=#{memberLevelId}")
    Float memberPrice(@Param("productId") Long productId, @Param("memberLevelId") Long memberLevelId);
}
